<!-- Copyright 2017 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================-->
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="../../bower_components/paper-listbox/paper-listbox.html">
<link rel="import" href="../../bower_components/paper-item/paper-item.html">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">

<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>

<dom-module id="nn-art">
  <style>
    .container {
      margin-left: 20px;
      margin-top: 20px;
    }

    li.mdl-menu__item {
      height: 40px;
      line-height: 40px;
    }
    .getmdl-select .mdl-icon-toggle__label {
        float: right;
        margin-top: -30px;
        color: rgba(0,0,0,0.4);
    }
  </style>
<template>
  <div class="container">
    <canvas id="inference"></canvas>
    <br>
    <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select getmdl-select__fix-height">
      <input class="mdl-textfield__input" type="text" id="colormode" value="rgb" readonly tabIndex="-1">
      <label for="colormode">
        <i class="mdl-icon-toggle__label material-icons">keyboard_arrow_down</i>
      </label>
      <label for="colormode" class="mdl-textfield__label">Color mode</label>
      <ul for="colormode" class="mdl-menu mdl-menu--bottom-left mdl-js-menu" id="color-selector">
        <li class="mdl-menu__item" data-val="rgb">rgb</li>
        <li class="mdl-menu__item" data-val="rgba">rgba</li>
        <li class="mdl-menu__item" data-val="hsv">hsv</li>
        <li class="mdl-menu__item" data-val="hsva">hsva</li>
        <li class="mdl-menu__item" data-val="yuv">yuv</li>
        <li class="mdl-menu__item" data-val="yuva">yuva</li>
        <li class="mdl-menu__item" data-val="bw">bw</li>
      </ul>
    </div>
    <br>
    <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select getmdl-select__fix-height">
      <input class="mdl-textfield__input" type="text" id="activation-fn" value="tanh" readonly tabIndex="-1">
      <label for="activation-fn">
        <i class="mdl-icon-toggle__label material-icons">keyboard_arrow_down</i>
      </label>
      <label for="activation-fn" class="mdl-textfield__label">Activation function</label>
      <ul for="activation-fn" class="mdl-menu mdl-menu--bottom-left mdl-js-menu" id="activation-selector">
        <li class="mdl-menu__item" data-val="tanh">tanh</li>
        <li class="mdl-menu__item" data-val="sin">sin</li>
        <li class="mdl-menu__item" data-val="relu">relu</li>
        <li class="mdl-menu__item" data-val="step">step</li>
      </ul>
    </div>
    <br>
    <div>Number of layers: <div id="layers-count" style="display: inline-block"></div></div>

    <p style="width:200px">
      <input class="mdl-slider mdl-js-slider" type="range" min="0" max="7" value="3" tabindex="1" id="layers-slider">
    </p>

    <div>z1 time coefficient</div>
    <p style="width:200px">
      <input class="mdl-slider mdl-js-slider" type="range" min="1" max="1000" value="100" tabindex="2" id="z1-slider">
    </p>
    <div>z2 time coefficient</div>
    <p style="width:200px">
      <input class="mdl-slider mdl-js-slider" type="range" min="1" max="1000" value="100" tabindex="3" id="z2-slider">
    </p>

    <button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent" type="button" id="random">randomize</button>
    <br><br>
    <a href="http://blog.otoro.net/2016/03/25/generating-abstract-patterns-with-tensorflow/" target="_blank">What is a CPPN?</a>
  </div>
</template>
</dom-module>
